<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">

<title>Internationalization</title>
	<link href="./manual.css" rel="stylesheet" type="text/css" />
  
</head>
<body>

<div id="container">
	<div id="main">

	
	<br>

<table style=" text-align: left;  margin-left: auto; margin-right: auto;" cellpadding="2" cellspacing="2" border="0">

  <tbody>
    <tr>
      <td style=" vertical-align: top;">
        <h1>HOWTO internationalize applications</h1>

        <span style="color: rgb(153, 51, 0);">Page updated May 12, 2013</span><br>

Internationalization of applications and scripts in Puppy Linux has become extremely easy, with MoManager, a GUI application.<br>

        <h2>Applications written in BaCon</h2>

BaCon is a BASIC compiler, one of our officially supported languages for
 Puppy development. Internationalization is supported by the compiler, 
as explained here:<br>

        <br>

        <a href="http://bkhome.org/bacon/international.htm">http://bkhome.org/bacon/international.htm</a> <br>

        <br>

There are at least two applications that you will find in every recent 
Puppy that are written in BaCon and have internationalization support:<br>

        <div style="margin-left: 40px;">
  <pre>/usr/sbin/welcome1stboot<br>/usr/local/simple_network_setup/proxy-setup</pre>
        </div>

If you have the 'devx' SFS loaded, then these will also be present:<br>

        <div style="margin-left: 40px;">
  <pre>/usr/sbin/welcome1stboot.bac<br>/usr/sbin/welcome1stboot.pupdev<br>/usr/share/doc/nls/welcome1stboot/welcome1stboot.pot
<br>/usr/local/simple_network_setup/proxy-setup.bac
/usr/local/simple_network_setup/proxy-setup.pupdev<br>/usr/share/doc/nls/proxy-setup/proxy-setup.pot<br></pre>
        </div>

The .bac file is the BaCon source code. The .pot file is the language 
translation file. The .pupdev file is just a text file which has 
instructions on how to compile and create a .pot language translation 
file, plus any other developer notes. The .pupdev is optional, not 
necessarily always in the 'devx' -- but 
if you read one of the .pupdev files it should show you how to create a 
.pot language translation file for any other BaCon application.<br>
<br>
When you compile a BaCon application, place the .pot file into 
/usr/share/doc/nls, as per the above examples. This could be in a PET 
package of your application. MoManager searches this path for .pot files
 to be translated.<br>
<br>
Actually, the same thing holds for any application, written in C, Vala, 
Genie, or whatever, place the .pot file into 
/usr/share/doc/nls/&lt;domainname&gt;/&lt;domainname&gt;.pot and 
MoManager will use it.<br>

        <h2>Scripts internationalized with 'gettext'</h2>

There are a lot of scripts in Puppy that use 'gettext' for translating. Here are some in /usr/sbin:<br>

        <div style="margin-left: 40px;">
  <pre>alsaconf<br>connectwizard<br>hostname-set<br>keymap-set<br>mousecheck<br>quicksetup<br>shutdownconfig</pre>
        </div>

Inside each script you will find a line like this:<br>
<pre>export TEXTDOMAIN=myapp</pre>
MoManager finds all scripts with this entry, which confirms that it uses
 'gettext', and offers a GUI interface for translating each script. You 
do not have to learn the commandline tools for translating, the GUI 
interface makes it easy.<br>
<br>
Basically, MoManager will create a .pot file for the application, in the
 above example that will be 'myapp.pot'. Note that multiple scripts can 
have the same domainname 'myapp' and just the one 'myapp.pot' will be 
created. So, if your application has several scripts, you don't have to 
have a .pot for each (but you can if you want), just have the one .pot 
-- this is more efficient if there are common text strings to be 
translated in the scripts, and is simpler just to have the one .pot 
file.<br>
<br>
One technical detail: please place the "export ..." at column one, and 
do not place quotes around "myapp", the line in the script should look 
just like I have shown:<br>
<pre>export TEXTDOMAIN=myapp</pre>

.pot files are "translation files", which you then have to insert the 
translations for a particular language. When that is done, it becomes a 
.po file, and it is then compiled to a binary form and becomes a .mo 
file. The compiled .mo files are kept at /usr/share/locale. MoManager 
handles these conversions for you.<br>
<h3>Pre-existing .pot files</h3>
MoManager will create a .pot file from the script, however the 
commandline-tool (xgettext) to extract the text strings from the script 
and create the .pot file does not always work properly. An example is 
/usr/sbin/alsaconf -- in this case, we have a pre-existing .pot file, 
/usr/share/doc/nls/alsaconf/alsaconf.pot.<br>
<br>
MoManager will automatically use any pre-existing .pot file that it 
finds in /usr/share/doc/nls, rather than use xgettext to extract the 
strings from the script(s).<br>
<h2>

MoManager translation manager</h2>
MoManager is a GUI application written by me (Barry Kauler) that makes 
it very easy for anyone to 
create non-English translations for applications in Puppy. You must have
 a Puppy built from a Woof 
version later than February 14, 2012, however if you want to use 
MoManager to create a "langpack" for a particular language it is 
recommended to use the very latest Puppy built from latest Woof -- see 
my blog (<a href="http://bkhome.org/blog2/">http://bkhome.org/blog2</a>) for announcements of Puppy builds.<br>
<br>
MoManager is for creating and updating translation files for scripts, 
XML files, menu files, any other data text files, and binary executables. <br>
<br>
Scripts are applications that are text files, 
usually written in Bash or Ash (or Perl, Python, Tcl, etc.). Note, if 
you are unfamiliar with 'scripts', don't worry, they are just 
applications.<br>
<br>
To use MoManager, the best thing to do is just go ahead and use it. You 
will find it in the 'Utility' menu. Once started, you will see two 
columns of drop-down lists, one list is of files that already have a 
translation file for your language (on left side), the other list is for files that 
do not yet have a translation file. if you select a file from the former
 list, you may update the translation, and in the latter case you may 
create a new translation file.<br>
<br>
Here is a snapshot of the main window, Puppy running with de_DE locale:<br>
<img style=" width: 862px; height: 574px;" alt="MoManager" src="http://puppylinux.com/development/MoManager.png">&nbsp;<br>
<h3>Scripts</h3>

In the case of updating an existing translation file, 
MoManager automatically synchronises with the latest script, and will 
identify any changed strings -- if you see the text "fuzzy" anywhere in 
the translation file, it is likely that the original English text has 
changed and you will need to update the translation.<br>
<br>
A translation file for a script means that when the application runs, it
 will output all text in your language. By creating translation files 
for all the scripts, you can help to create a Puppy that runs nicely in 
your language.<br>
<br>
Although it is probably possible to figure out how to edit a translation
 file, known as a 'po' file in it's editable form, or 'mo' file in it's 
compiled form, it is helpful to readup a bit on the topic. I suggest:<br>
<div style="margin-left: 40px;"><a href="http://translate.sourceforge.net/wiki/guide/project/howto">http://translate.sourceforge.net/wiki/guide/project/howto</a> <br>
</div>
<div style="margin-left: 40px;"><a href="http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#PO-Files">http://www.gnu.org/software/gettext/manual/html_node/gettext_9.html#PO-Files</a> <br>
</div>
<br>
...note though, reading all of that can be confusing! It is possible to 
use MoManager without understanding all of those details. MoManager uses
 a normal text editor to edit .po files rather than a specialized 
po-editor (such as poedit) and this is quite easy to do, you just need a
 very basic understanding of the format of .po files. <br>
<h3>poedit</h3>
This is a special text editor for .po files. Although MoManager uses the
 default text editor (usually Geany in most puppies), if poedit is 
installed then MoManager can use it -- you will see a checkbox in the 
main window of MoManager to choose poedit.<br>
<br>
To install poedit, look in the Puppy Package Manager. Most builds of Puppy will have it available.<br>
<h3>Langpack</h3>
You will also see in the MoManager window, a button to generate a 
"langpack" PET package. if you would like to translate Puppy for a 
particular language, this button is very nice. It will gather up all the
 translations for your language and put them into a PET package, which 
you can then send to me, and I can place it along with the others at 
ibiblio.org. See the existing "langpacks" at ibiblio.org, named 
"langpack_*.pet", for example "langpack_de-20120729.pet":<br>
<br>
<a href="http://distro.ibibilio.org/quirky/pet_packages-noarch/">http://distro.ibibilio.org/quirky/pet_packages-noarch/</a><br>
<br>
Note that the langpack is accumulative. Say for example that you install
 "langpack_de-20120729.pet" (German). You can then create some more 
translations, or update existing ones, then click the "Create langpack 
PET" button, and a new updated PET will be created. Please let me know if this mechanism leaves anything out!<br>
<br>
There are already maintainers for some languages, for example Puppy 
Forum member L18L maintains the German translation. So, if you want to 
contribute to the German translations please do it through L18L. At the 
time of writing, these are the translators:<br>
<table style=" text-align: left;" cellpadding="2" cellspacing="2" border="0">
  <tbody>
    <tr>
  <td valign="top"><i>da</i><i><br>
    </i></td>
  <td valign="top"><i>Danish</i><i><br>
    </i></td>
  <td valign="top"><i>maans</i><i><br>
    </i></td>
</tr>
<tr>
      <td style="vertical-align: top;"><i>de</i><i><br>
</i>
      </td>
      <td valign="top"><i>German</i><i><br>
  </i></td>
<td style="vertical-align: top;"><i>L18L</i><i><br>
</i>
      </td>
    </tr>
    <tr>
  <td valign="top"><i>el</i><i><br>
    </i></td>
  <td valign="top"><i>Greek</i><i><br>
    </i></td>
  <td valign="top"><i>kounelii</i><i><br>
    </i></td>
</tr>
<tr>
      <td style="vertical-align: top;"><i>es</i><i><br>
</i>
      </td>
      <td valign="top"><i>Spanish</i><i><br>
  </i></td>
<td style="vertical-align: top;"><i>vicmz</i><i><br>
</i>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;"><i>fr</i><i><br>
</i>
      </td>
      <td valign="top"><i>French</i><i><br>
  </i></td>
<td style="vertical-align: top;"><i>esmourguit</i><i><br>
</i>
      </td>
    </tr>
    <tr>
  <td valign="top"><i>it</i><i><br>
    </i></td>
  <td valign="top"><i>Italian</i><i><br>
    </i></td>
  <td valign="top"><i>vicmz (temporary)</i><i><br>
    </i></td>
</tr>
<tr>
  <td valign="top"><i>nl</i><i><br>
    </i></td>
  <td valign="top"><i>Dutch</i><i><br>
    </i></td>
  <td valign="top"><i>Bert</i><i><br>
    </i></td>
</tr>
<tr>
  <td valign="top"><i>pl</i><i><br>
    </i></td>
  <td valign="top"><i>Polish</i><i><br>
    </i></td>
  <td valign="top"><i>robwoj44</i><i><br>
    </i></td>
</tr>
<tr>
  <td valign="top"><i>pt</i><i><br>
    </i></td>
  <td valign="top"><i>Portuguese</i><i><br>
    </i></td>
  <td valign="top"><i>vicmz</i><i><br>
    </i></td>
</tr>
<tr>
      <td style="vertical-align: top;"><i>ru</i><i><br>
</i>
      </td>
      <td valign="top"><i>Russian</i><i><br>
  </i></td>
<td style="vertical-align: top;"><i>rodin.s</i><i><br>
</i>
      </td>
    </tr>
  </tbody>
</table>
<h3>Further information</h3>
If you want to learn more about MoManager, go to my blog <a href="http://bkhome.org/blog">http://bkhome.org/blog</a> and <a href="http://bkhome.org/blog2/">http://bkhome.org/blog2</a> (my new blog), and type "MoManager" into the search box.<br>
<br>
To interact with others working on translating Puppy, including asking 
questions about anything that puzzles you, please go to the Puppy Forum 
here: <a href="http://www.murga-linux.com/puppy/index.php?f=16">http://www.murga-linux.com/puppy/index.php?f=16</a> <br>
<br>
<br>
Regards,<br>
Barry Kauler<br>
<small>(c) This page is Copyright Barry Kauler 2012, 2013, all rights reserved.</small>&nbsp; <br>

      </td>
    </tr>
  </tbody>
</table>

<br>



<br>
	</div> <!--main-->
</div>
</body></html>